package nju.software.xkxt.data.dataobject;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import nju.software.xkxt.service.model.CourseModel;

/**
 * @author typ
 * 
 */
@Entity
@Table(name = "course", catalog = "xkxtbeta")
public class CourseDO implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -6836422578888618166L;
	private Integer CId;
	private Integer TId;
	private String CName;
	private Integer CType;
	private Date time;

	// Constructors

	/** default constructor */
	public CourseDO() {
	}

	/** minimal constructor */
	public CourseDO(Integer CId) {
		this.CId = CId;
	}

	/** full constructor */
	public CourseDO(Integer CId, Integer TId,String CName, Integer CType, Date time) {
		this.CId = CId;
		this.CName = CName;
		this.CType = CType;
		this.time = time;
		this.TId = TId;
	}
	
	public CourseDO(CourseModel model){
		CId = model.getCId();
		CName = model.getCName();
		CType = model.getCType();
		time = model.getTime();
		TId = model.getTId();
	}

	// Property accessors
	@Id
	@Column(name = "c_id", unique = true, nullable = false)
	public Integer getCId() {
		return this.CId;
	}

	public void setCId(Integer CId) {
		this.CId = CId;
	}

	@Column(name = "c_name", length = 50)
	public String getCName() {
		return this.CName;
	}

	public void setCName(String CName) {
		this.CName = CName;
	}

	@Column(name = "c_type")
	public Integer getCType() {
		return this.CType;
	}

	public void setCType(Integer CType) {
		this.CType = CType;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "time", length = 10)
	public Date getTime() {
		return this.time;
	}

	public void setTime(Date time) {
		this.time = time;
	}
	@Column(name = "t_id", unique = true, nullable = false)
	public Integer getTId() {
		return TId;
	}

	public void setTId(Integer tId) {
		TId = tId;
	}
}